package com.nxmu.action;

import com.nxmu.entity.ResearchEnter;
import com.nxmu.service.ResearchEnterService;
import com.opensymphony.xwork2.ModelDriven;

import java.util.List;

public class ResearchEnterAction extends BaseAction implements ModelDriven<ResearchEnter> {

    private ResearchEnter researchEnter;

    private List<ResearchEnter> list;

    public List<ResearchEnter> getList() {
        return list;
    }

    private ResearchEnterService researchEnterService;

    public void setResearchEnterService(ResearchEnterService researchEnterService) {
        this.researchEnterService = researchEnterService;
    }

    public String enter(){
        researchEnterService.enterResearchEnter(researchEnter);
        return SUCCESS;
    }

    public String list(){
        list = researchEnterService.getAll();
        return  "list";
    }

    @Override
    public ResearchEnter getModel() {
        researchEnter  = new ResearchEnter();
        return researchEnter;
    }
}
